// JavaScript Document

function Ajax(url, postData, callback){
	$.ajax({				 
		type: 'POST',
		data: postData,
		url: 'ajax.aspx?type=' + url + '&rnd=' + Math.random(),
		success: function(data) {
			if (data.indexOf('redirect') != -1){
				Redirect(data.substring(9));
			}
			else{
				callback(data);	
			}
		}
	});
}

function ChangeLanguage(lang){
	Ajax('language&code='  + lang, '', function(data){ window.location.reload(); });
}